<?php

try {

	// // 链接数据库
	$link = @new PDO("mysql:host=127.0.0.1;dbname=school;charset=utf8","root","root");

	$res = $link->exec("insert into stu (sname,age,sex) values('小森',18,'男')");

	var_dump($res);
	
	$res = $link->query('select * from stu');

	var_dump($res->fetchAll(PDO::FETCH_ASSOC));

	
} catch (Exception $e) {
	// echo($e->getMessage());
	echo("系统异常");
}



